import numpy as np
import struct
import os

def gen_golden_data_range():
    # 参数
    start = 1.0
    step = 0.5
    totalLength = 8 * 2048  # 16384
    tileNum = 8  # 可根据实际kernel设计调整

    # 生成golden
    golden = (start + np.arange(totalLength) * step).astype(np.float16)

    # 生成tiling结构体（假设顺序为 start, step, totalLength, tileNum）
    tiling = struct.pack('ffII', start, step, totalLength, tileNum)

    os.makedirs("./input", exist_ok=True)
    os.makedirs("./output", exist_ok=True)
    with open("./input/input_tiling.bin", "wb") as f:
        f.write(tiling)
    golden.tofile("./output/golden.bin")

if __name__ == "__main__":
    gen_golden_data_range()